<?php 
class Email_Model_Index extends Zend_Db_Table
{
	
	
	public function connectSmtp(){
		$front = Zend_Controller_Front::getInstance();
        $bootstrap = $front->getParam('bootstrap');
        $bootstrapSettings = $bootstrap->getOptions();        
        $smtpSettings = $bootstrapSettings['resources'];
		
        
        
		$smtpServer = $smtpSettings['mail']['transport']['host'];
		$port = $smtpSettings['mail']['transport']['port']; 
		
		$params = array(
            		'username' => $smtpSettings['mail']['transport']['username'],
            		'password' => $smtpSettings['mail']['transport']['password']
       	);		
		
		$connection =  new Zend_Mail_Protocol_Smtp_Auth_Login($smtpServer , $port, $params);
        $connection->connect();
        $connection->helo($smtpServer );
        	
       	$transport = new Zend_Mail_Transport_Smtp();
        $transport->setConnection($connection);	
        
        return $transport;
	}
	
}
 